Skip to content

Remove Character.toChars, highSurrogate, lowSurrogate models #4534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2019

Conversation

smowton
Copy link
Contributor

@smowton smowton commented Apr 15, 2019

Character.toChars was malformed (it tried to address a java::array[char] * like it was
a raw char[], and tried to return an if_exprt of two arrays of differing type), and there
is already a perfectly good implementation in the models library.

Character.highSurrogate and lowSurrogate were type unsound (creating additions of mixed type).
Again, they add nothing on top of the shipped models library.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️
Passed Diffblue compatibility checks (cbmc commit: d5795b5).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/108337049

public class C {

public void test() {
char[] c = Character.toChars(5);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛏️ Bad indent

--function C.test --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test will pass even if toChars is not implemented. because unreachable evaluates to true. Could we add an assertion that we expect to fail?

@romainbrenguier
Copy link
Contributor

I think we could even remove the whole character preprocessing now that we have a model for it (it would better to have tests for it though).

@smowton smowton force-pushed the smowton/fix/character-tochars branch from d5795b5 to c725551 Compare April 15, 2019 15:21
@smowton
Copy link
Contributor Author

smowton commented Apr 15, 2019

@allredj changes applied
@romainbrenguier I'll leave it to you if you want to destroy the whole model; just fixing my particular invariant failure here.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️
Passed Diffblue compatibility checks (cbmc commit: c725551).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/108385615

Character.toChars was malformed (it tried to address a java::array[char] * like it was
a raw char[], and tried to return an if_exprt of two arrays of differing type), and there
is already an implementation in the models library with a perfectly good implementation.

Character.highSurrogate and lowSurrogate were type unsound (creating additions of mixed type).
Again, they add nothing on top of the shipped models library.
@smowton smowton force-pushed the smowton/fix/character-tochars branch from c725551 to c6c9368 Compare April 16, 2019 14:19
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️
Passed Diffblue compatibility checks (cbmc commit: c6c9368).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/108541289

@smowton smowton merged commit d5df938 into diffblue:develop Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants